package com.heima.behavior.controller.v1;

import com.heima.api.behavior.ApBehaviorEntryControllerApi;
import com.heima.behavior.service.ApBehaviorEntryService;
import com.heima.model.behavior.dtos.BehaviorEntryDto;
import com.heima.model.behavior.pojos.ApBehaviorEntry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @作者 itcast
 * @创建日期 2020/10/8 15:32
 **/
@RestController
@RequestMapping("/api/v1/behavior_entry")
public class ApBehaviorEntryController implements ApBehaviorEntryControllerApi {
    @Autowired
    ApBehaviorEntryService apBehaviorEntryService;
    @GetMapping("/one")
    @Override
    public ApBehaviorEntry findByUserIdOrEquipmentId(
            @RequestParam("userId") Integer userId,
            @RequestParam("equipmentId") Integer equipmentId
           ) {
        return apBehaviorEntryService.findByUserIdOrEquipmentId(userId,equipmentId);
    }
}
